:- use_module(tp2).

% Ejemplos de uso
%    ham1(X, Y, N).
%    prefs3(X, Y, N).
%    ed2(X, Y, N).

ham1([], [0], N) :- distHam([], [0], N).
ham2([0, 1], [0, 1], N) :- distHam([0, 1], [0, 1], N).
ham3([0, 1, 0], [0, 0, 1], N) :- distHam([0, 1, 0], [0, 0, 1], N).
ham4([0, 1, 0], [X, Y, 1], N) :- distHam([0, 1, 0], [X, Y, 1], N).
ham5([0, 1, 0], X, 2) :- distHam([0, 1, 0], X, 2).
ham6([plp], [plp], N) :- distHam([plp], [plp], N).
ham7([0,0,0,1,1], [1,1,0,0,0], 1) :- distHam([0,0,0,1,1], [1,1,0,0,0], 1).

prefs1([0,1,1],[0,1,1,1],N) :- distPref([0,1,1],[0,1,1,1],N).
prefs2([0,1,1],[0,1,X,Y],N) :- distPref([0,1,1],[0,1,X,Y],N).
prefs3([0,1,1],X,2) :- distPref([0,1,1],X,2).
prefs4([plp],X,N) :- distPref([plp],X,N).
prefs5([0,1,1,1], [1|Xs], 2) :- distPref([0,1,1,1], [1|Xs], 2).
prefs6([0,1,1,1], [0|Xs], 2) :- distPref([0,1,1,1], [0|Xs], 2).
prefs7([], X, N) :- distPref([], X, N).
prefs8([0,0,1,1,1,1], [X|[1,0]], N) :- distPref([0,0,1,1,1,1], [X|[1,0]],N).
prefs9([0,0,1,1,1,1], [X|[1,0,X,Y,Z]], N) :- distPref([0,0,1,1,1,1], [X|[1,0,X,Y,Z]],N).
prefs10([1],[] , N) :- distPref([1], [], N).

ed1([0,0,1,1], [1,1,0], N) :- distEd([0,0,1,1], [1,1,0], N).
ed2([0,0,1], [1,1,X,Y], N) :- distEd([0,0,1], [1,1,X,Y], N).
ed3([0,1,1,1], [1|Xs], 2) :- distEd([0,1,1,1], [1|Xs], 2).
ed4(plp, X, N) :- distEd(plp, X, N).
ed5([0,1], [X,plp|Xs], N) :- distEd([0,1], [X,plp|Xs], N).
ed6([0,1], [X,0|Xs], 0) :- distEd([0,1], [X,0|Xs], 0).
ed7([0,1], [X,1|Xs], 0) :- distEd([0,1], [X,1|Xs], 0).
ed8([0,0,0], [0,1,1,1,1,plp,1], 1) :- distEd([0,0,0], [0,1,1,1,1,plp,1], 1).
ed9([0,0,0], [0,1,1,1,1,plp,1], N) :- distEd([0,0,0], [0,1,1,1,1,plp,1], N).
ed10([0,0,0], [0,1,1,1,1], N) :- distEd([0,0,0], [0,1,1,1,1], N).
ed11([0,0,0], [0,1,1,1|[X,plp]], N) :- distEd([0,0,0], [0,1,1,1|[X,plp]], N).
ed12([0,0,0], [0,1,1,X,Y], N) :- distEd([0,0,0], [0,1,1,X,Y], N).
ed13([], [], N) :- distEd([], [], N).
ed14([], X, N) :- distEd([], X, N).
ed15([], [X,Y,Z], N) :- distEd([], [X,Y,Z], N).
ed16([0,0,0,0,0,1,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], N) :- distEd([0,0,0,0,0,1,0,0,0,0], [0,0,0,0,0,0,0,0,0,0], N).
ed17([0,0,0], [0,1,1,1,1,1,1], 1) :- distEd([0,0,0], [0,1,1,1,1,1,1], 1).
ed18([0,1,1,1,1,1,1], [0,1,1,1,1,1,1], 0) :- distEd([0,1,1,1,1,1,1], [0,1,1,1,1,1,1], 0).
ed19([0,1], [Y,X], N) :- distEd([0,1], [Y,X], N).
ed20([0,1,1], [Y,X], N) :- distEd([0,1,1], [Y,X], N).
ed21([0,1,1,1], [Y,X], N) :- distEd([0,1,1,1], [Y,X], N).
ed22([0,1,1,1,1], [Y,X], N) :- distEd([0,1,1,1,1], [Y,X], N).
ed23([0], L, N) :- distEd([0], L, N).
ed24([1], L, N) :- distEd([1], L, N).

